//:C05:DotTemplate.cpp
// Illustrate the .template construct.
#include <bitset>
#include <cstddef>
#include <iostream>
#include <string>
using namespace std;

template<class charT, size_t N>
basic_string<charT> bitsetToString(const bitset<N>& bs) {
  return bs.template to_string<charT, char_traits<charT>,
    allocator<charT>>();
}

int main(void) {
  bitset<10> bs;  
  bs.set(1);
  bs.set(5);
  cout << bs << endl;    // 0000100010
  string s = bitsetToString<char>(bs);
  cout << s << endl;    // 0000100010
}